<?php
/**
 * Created by PhpStorm.
 * User: allen_ios
 * Date: 17/4/24
 * Time: 上午11:10
 */

class RestaurantPrintMoneyModel extends BaseModel
{
    protected $tableName = "restaurant_print_money";

    public function getMoneyList($resId)
    {
        //获得金额配置的信息
        $cacheKey = "restaurant_print_money_".$resId;
        $cacheData = RedisService::get($cacheKey);
        if ($cacheData) {
            return $cacheData;
        }

        //从数据表中获取数据
        $condition = array(
            'res_id' => $resId
        );
        $listData = $this->getList($condition,'*',null,null,null);
        if (!$listData) {
            return null;
        }

        //设置缓存
        RedisService::set($cacheKey,$listData,86400);
        return $listData;
    }
}